package com.zhongkun.datahome.service.req.cmd.customer;

import com.zhongkun.datahome.service.domain.CustomerBase;
import com.zhongkun.datahome.service.processor.dto.HouseMaterialDto;
import com.zhongkun.datahome.service.req.cmd.house.CustomerHouseCmd;
import lombok.Data;

/**
 * @Author: lifengsheng
 * @Date: 2025/4/16 17:50
 * @Desc
 */
@Data
public class CustomerBaseCmd extends CustomerBase {

    public static CustomerBaseCmd of(CustomerHouseCmd cmd) {
        CustomerBaseCmd customerBaseCmd = new CustomerBaseCmd();
        customerBaseCmd.setCustomerName(cmd.getCustomerName());
        customerBaseCmd.setMobile(cmd.getMobile());

        return customerBaseCmd;
    }

    public static CustomerBaseCmd of(HouseMaterialDto cmd) {
        CustomerBaseCmd customerBaseCmd = new CustomerBaseCmd();
        customerBaseCmd.setCustomerName(cmd.getCustomerName());
        customerBaseCmd.setMobile(cmd.getMobile());

        return customerBaseCmd;
    }
}
